home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ WinXP AutoPlay 11.xpl < prev    next >
Text File  |  2003-08-02  |  7KB  |  264 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="8"
  3. "COUNT"="2"
  4. "UIPATH 1"="System\AutoPlay\Handler Assignment"
  5. "NAME"="Handler Assignment for DVDs"
  6. "OSVERSION"="0000011"
  7. "VERSION"="1.03"
  8. "LANGUAGE"="VBScript"
  9. "TEXT 1"="Show Info"
  10. "TEXT 2"="Enable/Disable"
  11. "DESCRIPTION 1"="When Windows detects a CD-ROM (or any other media) which does not contain an AUTORUN.INF normally needed for AutoPlay, Windows will check if there are any "handlers" available that can "handle" the contents of the CD-ROM.
  12. "DESCRIPTION 2"="For example, when you insert a Video-CD usually does not contain an AUTORUN.INF, Windows will check if there is one or more handlers registered to handle this Video-CD. If so, a window will pop up displaying the registered handlers so you can easily choose one. You can also select one of these handlers as the default selection for the current type of CD-ROM.
  13. "DESCRIPTION 3"="With this plug-in you can view which handlers are assign to the CD type and also change them. Click "Show Info" to see which command is executed when you select a handler or click "Enable/Disable" to activate or disable a handler. When you just have added a customer handler, you will find it at the end of the list as "X-Setup AutoPlay CustomHandlerX".
  14. "DESCRIPTION 4"="IMPORTANT: The AutoPlay window (where you can select one of the activated handlers) will _NOT_ show up if either a default handler is set, or only one handler is defined. 
  15. "DESCRIPTION 5"="To reset the list of default handlers, use the "Reset AutoPlay Default Handler Selection" plug-in inside the folder "Troubleshooting". 
  16. "AUTHOR"="Xteq Systems"
  17. "CONTACTURL"="http://www.xteq.com"
  18. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  19. "COMMENT 1"=" "
  20.  
  21.  
  22. '/*** MAIN TEMPLATE IS THIS FILE ***/
  23. '/*** ONLY CHANGE REGISTRY KEYS BELOW ***/
  24.  
  25. C_CD_EVENT="PlayDVDMovieOnArrival"
  26.  
  27.  
  28.  
  29.  
  30.  
  31. '/////////////////////////////////
  32. '///*** NO CHANGES BELOW HERE ***/
  33.  
  34. sP="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\" & C_CD_EVENT & "\"
  35.  
  36. XSET_GCHI_Name=""
  37. XSET_GCHI_EXE=""
  38.  
  39.  
  40. sPD1="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\"
  41.  
  42. sPClass="HKLM\Software\Classes\"
  43.  
  44. sInvoke1="\InvokeProgid"
  45. sInvoke2="\InvokeVerb"
  46.  
  47. sInvokeA="\ProgID"
  48. sInvokeB="\InitCmdLine"
  49.  
  50. Dim ary1()
  51. Dim ary2()
  52.  
  53. Dim iReadAllCount
  54.  
  55. sActive=" [ACTIVE] "
  56.  
  57.  
  58. Sub Plugin_Initialize 
  59.   iReadAllCount=0
  60.   Call ReloadAll
  61. End Sub
  62.  
  63. Sub ReloadAll
  64.  for i=1 to iReadAllCount
  65.      Call SetUIElement(i,"")
  66.  next 
  67.  
  68.  i1=0
  69.  i1=RegEnumValues(sP)
  70.  ReDim ary1(i1)
  71.  
  72.  i2=0
  73.  i2=RegEnumPaths(sPD1)
  74.  ReDim ary2(i2)
  75.  
  76.  Call ReadAll(sP)
  77.  Call ReadAllPaths(sPD1)
  78.  
  79.  
  80.  iReadAllCount=1
  81.  
  82.  for i=1 to i1
  83.      Call SetUIElement(iReadAllCount,sActive & ary1(i))
  84.      iReadAllCount=iReadAllCount+1
  85.  next
  86.  
  87.  for i=1 to i2
  88.      sName=ary2(i)
  89.      bExists=false
  90.  
  91.      'check if the handler already exists
  92.      for e=1 to i1
  93.          if sName=ary1(e) then
  94.             bExists=true
  95.             exit for
  96.          end if
  97.      next 
  98.  
  99.      if bExists=false then 
  100.         Call SetUIElement(iReadAllCount,ary2(i))
  101.         iReadAllCount=iReadAllCount+1
  102.      end if
  103.  next 
  104.  
  105. End Sub
  106.  
  107. Sub ReadAll(key)
  108.  iC=RegEnumValues(key)
  109.  if iC>0 then
  110.     for l=1 to iC
  111.         sName=RegEnumElement(l)
  112.         
  113.         ary1(l)=sName
  114.  
  115.         iReadAllCount=iReadAllCount+1
  116.     Next
  117.  end if
  118. End Sub
  119.  
  120.  
  121. Sub ReadAllPaths(key)
  122.  iC=RegEnumPaths(key)
  123.  if iC>0 then
  124.     for l=1 to iC
  125.         sName=RegEnumElement(l)
  126.         
  127.         ary2(l)=sName
  128.  
  129.         iReadAllCount=iReadAllCount+1
  130.     Next
  131.  end if
  132. End Sub
  133.  
  134.  
  135. Sub Plugin_CheckData(ElementIndex)
  136. End Sub
  137.  
  138. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  139.  if ElementSubIndex>0 then
  140.     sName=GetUIElement(ElementSubIndex)    
  141.     sRealName=""
  142.     bIsActivated=false
  143.     if InStr(sName,sActive)>0 then 
  144.        sRealName=ary1(ElementSubIndex)
  145.        bIsActivated=true
  146.     else 
  147.        sRealName=sName
  148.     end if
  149.     
  150.     if ElementIndex=1 then 
  151.        Call GetCommandNameAndExe(sRealName)
  152.  
  153.        Call MsgInformation("This item is called <" & XSET_GCHI_Name & "> and the command line that will be executed is <" & XSET_GCHI_Exe & ">")
  154.     else
  155.        if bIsActivated=true then
  156.           Call RegDeleteValue(sP & sRealName)
  157.           Call ReloadAll() 
  158.        else
  159.           Call RegWriteValue(sP & sRealName,"",1)
  160.           Call ReloadAll()
  161.        end if
  162.  
  163.     end if
  164.  end if
  165. End Sub
  166.  
  167. Sub GetCommandNameAndExe(HandlerID)
  168.  Dim sRegPath
  169.  sRegpath=sPD1 & HandlerID
  170.  
  171.  sProgID=RegReadValue(sRegPath & sInvoke1)
  172.  sVerb=RegReadValue(sRegPath & sInvoke2)
  173.  
  174.  '''Call DebugMsg("ProgID: " & sProgID)
  175.  '''Call DebugMsg("sVerb: " & sVerb)
  176.  
  177.  if len(sProgID)=0 then
  178.     sProgID=RegReadValue(sRegpath & sInvokeA)
  179.  end if 
  180.  
  181.  Call XSET_GetCOMHandlerInformation(sProgID,sVerb)
  182. End Sub
  183.  
  184.  
  185. Sub Plugin_Terminate 
  186. End Sub
  187.  
  188.  
  189. '*** Get COM Handler Information Version 1.0 ***
  190. '*** WARNING! Requires several global variables: ***
  191. '*** XSET_GCHI_Name -> Name of the command ***
  192. '*** XSET_GCHI_EXE  -> What will be executed ***
  193. Function XSET_GetCOMHandlerInformation(HandlerID,VerbID)
  194.  XSET_GCHI_Local_C_BasePath="HKLM\Software\Classes\"
  195.  XSET_GCHI_Local_C_CurVer="\CurVer\@"
  196.  
  197.  ''Call MsgInformation(HandlerID)
  198.  
  199.  'save the handlerID
  200.  XSET_GCHI_Local_Handler1=HandlerID
  201.  
  202.  'construct reg path 1
  203.  XSET_GCHI_Local_Reg1=XSET_GCHI_Local_C_BasePath & XSET_GCHI_Local_Handler1 & "\@"
  204.  XSET_GCHI_Local_RegHandler=XSET_GCHI_Local_C_BasePath & XSET_GCHI_Local_Handler1 & "\"
  205.  
  206.  'get the default name
  207.  XSET_GCHI_Local_Name1=RegReadValue(XSET_GCHI_Local_Reg1)
  208.  
  209.  'now check if there is a newer version available
  210.  XSET_GCHI_Local_Reg1=XSET_GCHI_Local_C_BasePath & HandlerID & XSET_GCHI_Local_C_CurVer
  211.  
  212.  'get the newer version (if any)
  213.  XSET_GCHI_Local_CurVer1=RegReadValue(XSET_GCHI_Local_Reg1)
  214.  
  215.  if IsEmpty(XSET_GCHI_Local_CurVer1)=false then
  216.     'damn it, there is a newer version available
  217.  
  218.     XSET_GCHI_Local_Handler1=XSET_GCHI_Local_CurVer1
  219.  
  220.     'construct reg path
  221.     XSET_GCHI_Local_Reg1=XSET_GCHI_Local_C_BasePath & XSET_GCHI_Local_Handler1 & "\@"
  222.     XSET_GCHI_Local_RegHandler=XSET_GCHI_Local_C_BasePath & XSET_GCHI_Local_Handler1 & "\"
  223.  
  224.     'read it 
  225.     XSET_GCHI_Local_Name2=RegReadValue(XSET_GCHI_Local_Reg1)
  226.  
  227.     'check the names...
  228.     if len(XSET_GCHI_Local_Name2)>0 then
  229.        XSET_GCHI_Local_Name1=XSET_GCHI_Local_Name2 
  230.     end if
  231.  end if
  232.  
  233.  'check if we have a name...
  234.  if len(XSET_GCHI_Local_Name1)=0 then
  235.     'Okay, we do not have a name...
  236.     XSET_GCHI_Local_Name1="COM:" & XSET_GCHI_Local_Handler1
  237.  end if
  238.  
  239.  '''Call MsgInformation(XSET_GCHI_Local_RegHandler)
  240.  
  241.  'save this name
  242.  XSET_GCHI_Name=XSET_GCHI_Local_Name1
  243.  
  244.  
  245.  
  246.  'now check for the Command
  247.  XSET_GCHI_Local_GetEXERegPath=XSET_GCHI_Local_C_BasePath & XSET_GCHI_Local_Handler1 & "\Shell\" & VerbID & "\command\@"
  248.  '''Call MsgInformation(XSET_GCHI_Local_GetEXERegPath)
  249.  XSET_GCHI_Local_GetEXE_Value=RegReadValue(XSET_GCHI_Local_GetEXERegPath)
  250.  if IsEmpty(XSET_GCHI_Local_GetEXE_Value)=false then
  251.     XSET_GCHI_EXE=XSET_GCHI_Local_GetEXE_Value
  252.  else
  253.     XSET_GCHI_EXE="UNKNOWN"
  254.  end if
  255.  
  256.  
  257.  ''Call MsgInformation("RES: " & XSET_GCHI_Local_Name1)
  258.  ''Call MsgInformation("CMD: " & XSET_GCHI_EXE)
  259. End Function
  260.  
  261.  
  262.  
  263.  
  264.